﻿Imports capaNegocios

Public Class secHorario_buscar
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Me.lblGradoDetalle.Text = Request.QueryString("grado")
        Me.lblNivelDetalle.Text = Request.QueryString("nivel")
        Me.lblSeccionDetalle.Text = Request.QueryString("seccion")

        Dim objHorario As clsHorario = New clsHorario()
        Dim registros As DataRowCollection = objHorario.Buscar(Me.lblGradoDetalle.Text, Date.Now.Year.ToString, Me.lblSeccionDetalle.Text).Rows
        dgvHorario.DataSource = objHorario.CrearHorario(registros)
        dgvHorario.DataBind()
    End Sub

    Protected Sub btnBuscarHorario_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnBuscarHorario.Click
        Dim url As String
        url = "secHorario_buscar.aspx?nivel=" + Me.ddlNivelBuscar.SelectedValue + "&grado=" + Me.ddlGradoBuscar.SelectedValue + "&seccion=" + Me.ddlSeccionBuscar.SelectedValue
        Response.Redirect(url)
    End Sub

    Protected Sub btnModificarHorario_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnModificarHorario.Click
        Response.Redirect("secHorario_modificar.aspx?nivel=" & Me.lblNivelDetalle.Text & "&grado=" & Me.lblGradoDetalle.Text & "&seccion=" & Me.lblSeccionDetalle.Text)
    End Sub
End Class